<script setup>
import DocsLayout from '@/components/layout/DocsLayout.vue'
import letter from '@/assets/letter.png'
import { disableBlackTheme } from './utils/tool'
import { useRouter } from 'vue-router'
import { onMounted } from 'vue'

/** 该模块禁止暗色模式 */
disableBlackTheme()
const ro = useRouter()
const handleRouteChange = () => {
  disableBlackTheme()
}
onMounted(() => {
  ro.afterEach(handleRouteChange)
})
</script>
<template>
  <docs-layout title="给未来写封信" :logo="letter" :open="['1', '2']">
    <el-sub-menu index="2">
      <template #title>
        <span>协议</span>
      </template>
      <el-menu-item index="/letter/docs/law">
        <template #title>
          <span>服务条款</span>
        </template>
      </el-menu-item>
      <el-menu-item index="/letter/docs/public">
        <template #title>
          <span>公开信授权</span>
        </template>
      </el-menu-item>
      <el-menu-item index="/letter/docs/log">
        <template #title>
          <span>更新日志</span>
        </template>
      </el-menu-item>
    </el-sub-menu>

    <el-sub-menu index="1">
      <template #title>
        <span>其他</span>
      </template>
      <el-menu-item index="/letter/docs/about">
        <template #title>
          <span>关于我们</span>
        </template>
      </el-menu-item>
      <el-menu-item index="/letter/docs/problem">
        <template #title>
          <span>常见问题</span>
        </template>
      </el-menu-item>
    </el-sub-menu>
  </docs-layout>
</template>
